package com.xmkj.winmoney.jifen;

import android.content.Context;
import android.widget.ImageView;

import com.common.Entity.DuobaoDaShangBean;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.xmkj.winmoney.R;

import java.util.List;

/**
 * Create by leo
 * 创建日期：2018/5/22
 * 描述：
 */

public class DaShangAdapter extends CommonAdapter<DuobaoDaShangBean> {
    public DaShangAdapter(Context context, List<DuobaoDaShangBean> data) {
        super(context, data);
    }

    @Override
    protected void convert(ViewHolder holder, DuobaoDaShangBean item, int position) {
       ImageView ivChoose =  holder.getView(R.id.iv_choose);
       ivChoose.setBackgroundResource(item.is_select?R.mipmap.choose:R.mipmap.circle);
        holder.setOnClickListener(R.id.iv_choose,new OnItemChildClickListener() );
        holder.setText(R.id.tv_jifen,"感谢你支持"+item.score+"积分");
        holder.setText(R.id.tv_desc,item.describe);
    }

    @Override
    protected int getItemViewLayoutId(int position, DuobaoDaShangBean item) {
        return R.layout.item_dashang;
    }
}
